<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/allApp.css" />
		<link rel="stylesheet" href="css/css.css" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">设备信息</h1>
		</header>
		<div class="mui-content">
			<div class="fj-content" id="fj-content">
				<div class="mui-row fj-row">
					<span class="mui-pull-left mui-col-xs-3">设备名称</span>
					<div class="mui-pull-right  mui-col-xs-9" id="name"style="text-align: right;">
						<span>{{data.name}}</span>
					</div>
				</div>
				<div class="mui-row fj-row">
					<span class="mui-pull-left">设备编号</span>
					<div class="mui-pull-right">
						<span>{{data.number}}</span>
					</div>
				</div>
				<!--<div class="mui-row fj-row">
					<span class="mui-pull-left">设备id</span>
					<div class="mui-pull-right">
						<span>{{data.id}}</span>
					</div>
				</div>-->
				<div class="mui-row fj-row">
					<span class="mui-pull-left">设备创建时间</span>
					<div class="mui-pull-right">
						<span>{{data.create_time}}</span>
					</div>
				</div>
				<div class="mui-row fj-row" v-if="data.type ===0">
					<span class="mui-pull-left">设备类型</span>
					<div class="mui-pull-right">
						<span>室内设备</span>
					</div>
				</div>
				<div class="mui-row fj-row" v-else="data.type ===0">
					<span class="mui-pull-left">设备类型</span>
					<div class="mui-pull-right">
						<span>室外设备</span>
					</div>
				</div>
				<div class="mui-row fj-row">
					<span class="mui-pull-left">设备所属风场名称</span>
					<div class="mui-pull-right">
						<span>{{data.windname}}</span>
					</div>
				</div>
				<div class="mui-row fj-row" v-if="data.status ===0">
					<span class="mui-pull-left">设备审核状态</span>
					<div class="mui-pull-right">
						<span>未审核</span>
					</div>
				</div>
				<div class="mui-row fj-row" v-else="data.status ===1">
					<span class="mui-pull-left">设备审核状态</span>
					<div class="mui-pull-right">
						<span>已审核</span>
					</div>
				</div>
				<div class="mui-row fj-row">
					<span class="mui-pull-left">设备负责人</span>
					<div class="mui-pull-right">
						<span>{{data.membername}}</span>
					</div>
				</div>

				<!--<div class="mui-row fj-row">
					<span class="mui-pull-left">设备负责人id</span>
					<div class="mui-pull-right">
						<span>{{data.member_id}}</span>
					</div>
				</div>-->

				<div class="mui-row fj-row">
					<span class="mui-pull-left">设备负责人联系方式</span>
					<div class="mui-pull-right">
						<span>{{data.tell}}</span>
					</div>
				</div>
				<!--<div class="mui-row fj-row">
					<span class="mui-pull-left">设备使用模板id</span>
					<div class="mui-pull-right">
						<span>{{data.templat_id}}</span>
					</div>
				</div>-->

			</div>

		</div>

		<script src="../../js/mui.min.js"></script>
		<script type="text/javascript" src="../../js/mkeyplus.base.xunjian.js"></script>
		<script src="../../js/vue.js"></script>
		<script src="./js/websql.js"></script>
		<script src="../../js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript">
			mui.init()

			var vm = new Vue({
				el: "#fj-content",
				data: {
					data: {}
				},

			});
			var xsdwindid = '';
			mui.plusReady(function() {
				var self = plus.webview.currentWebview();
				var rate = self.index;
				xsdwindid = self.xsdwindid;
				var scancode = self.scancode;
				if (plus.networkinfo.getCurrentType()  ==  plus.networkinfo.CONNECTION_NONE)  {
					websqlOpenDB();
					//					function selectALlData() {                  
					console.log("查找全部数据");                 
					//			            websqlGetAllData(websqlTable);              
					websqlGetAllData(sbInfoTable);             
					websqlGetAllData(jcxInfoTable);             
					//			        }
					websqlGetAData(sbInfoTable, scancode, rate);
				} else {
					// if(rate == "4") {//进入特殊巡检项查看
						mui.baseApp.httpRequst('/api/v2/sbxj/findSbInfo', {
								scancode: scancode
							},
							function(res) {
								console.log("特殊巡检项" + JSON.stringify(res));
								var data = res.data;
								console.log("巡检项1111" + JSON.stringify(data));
								if(res.status == 200) {
									vm.data = data;
									console.log(JSON.stringify(vm.data));
								} else if(res.status == 400) {
									mui.toast(data.message)
								} else if(res.status == 409) {
									mui.toast(data.message)
								}
							}
						);
					// } else {

						// mui.baseApp.httpRequst('/api/v2/sbxj/createUserXj', {
						// 		memberId: localStorage.getItem('userid'),
						// 		scancode: scancode,
						// 		rate: rate,
						// 		xsdWindId:xsdwindid
						// 	},
						// 	function(res) {
						// 		console.log("巡检项" + JSON.stringify(res));
						// 		var data = res.data;
						// 		var sbInfo = data.sbInfo;
						// 		console.log("巡检项1111" + JSON.stringify(sbInfo));
						// 		if(res.status == 200) {
						// 			vm.data = sbInfo;
						// 			console.log(JSON.stringify(vm.data));
						// 		} else if(res.status == 400) {
						// 			mui.toast(data.message)
						// 		} else if(res.status == 409) {
						// 			mui.toast(data.message)
						// 		}
						// 	}
						// );
					// }
				}
			})

			function success(sbInfo_) {
				var sbInfo_list = sbInfo_.List;
				console.log('sbInfo_list' + JSON.stringify(sbInfo_list));
				vm.data = sbInfo_list;
				name = sbInfo_list.name;
				rateid = sbInfo_list.rateid;
				//				alert(rateid);
			}
			console.log('vm.data' + JSON.stringify(vm.data));
		</script>
	</body>

</html>